package com.ntv.common;

public enum NewsCategory {

	GULF(1000L, "Gulf"), 
	KARNATAKA(1001L, "Karnataka"), 
	INTERNATIONAL(1002L, "International"), 
	SPORTS(1003L, "Sports"), 
	ENTERTAINMENT(1004L, "Entertainment"), 
	LIFE_STYLE(1005L, "Life-Style"), 
	BUSINESS(1006L, "Business");

	private Long id;
	private String label;

	NewsCategory(Long id, String label) {
		this.id = id;
		this.label = label;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the label
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * @param label
	 *            the label to set
	 */
	public void setLabel(String label) {
		this.label = label;
	}
	
	public static final NewsCategory getNewsCategory(Long id) {
		NewsCategory[] categories = NewsCategory.values();
		for (NewsCategory newsCategory : categories) {
			if (id.equals(newsCategory.getId()))
				return newsCategory;
		}
		return null;
	}

}
